From: Florian Müllner Date: Mon, 9 Oct 2017 22:04:56 +0000 (+0200) Subject: workspace: Don't move focus unconditionally X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~970^2^2~3 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=09d3cdb023d3a9a3e558c7c76084796f2e348e3c;p=gnome-shell.git workspace: Don't move focus unconditionally Since commit 1939e22c22c, we move the keyboard focus with the hover highlight. However while this makes sense when interacting with the window picker, it interferes with keyboard navigation of other components like dash or top bar. Address this by only moving the focus when the previous focus was already inside the window picker or unset. https://gitlab.gnome.org/GNOME/gnome-shell/issues/50 --- diff --git a/js/ui/workspace.js b/js/ui/workspace.js index d049eae61..1e121b778 100644 --- a/js/ui/workspace.js +++ b/js/ui/workspace.js @@ -660,7 +660,6 @@ var WindowOverlay = new Lang.Class({ if (this._hidden) return; - this._windowClone.actor.grab_key_focus(); this._animateVisible(); this.emit('show-close-button'); }, @@ -1852,7 +1851,12 @@ var Workspace = new Lang.Class({ this.actor.add_actor(clone.actor); - overlay.connect('show-close-button', this._onShowOverlayClose.bind(this)); + overlay.connect('show-close-button', () => { + let focus = global.stage.key_focus; + if (focus == null || this.actor.contains(focus)) + clone.actor.grab_key_focus(); + this._onShowOverlayClose(overlay); + }); if (this._windows.length == 0) clone.setStackAbove(null);